<!DOCTYPE html>
<html>
  <head>
    <title><%= title %></title>
    <link rel='stylesheet' href='/stylesheets/style.css' />
      <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js" ></script>
      </head>
  <body>
    <h1><%= title %></h1>
    <p>2017-9-28 陈宗豪 201592452 软日1505</p>
    <input type="text" name="token" id="input">
    <div id="output"></div>

    <a href="/">返回首页</a>
    <div><script src="https://code.csdn.net/snippets/2589295.js"></script></div>

  </body>
  <script>
      $("#input").keypress(function(event) {

          var keycode = (event.keyCode ? event.keyCode : event.which);
          if (keycode == '13') {
              var input_text = $("#input").val();
//              console.log("[\""+input_text+"\"]");

              $.ajax({
                  url:"/test/01",
                  type:"post",
                  data:"[\""+input_text+"\"]",
                  contentType:"application/json;charset=utf-8",
                  dataType:'json',
                  success:function (table) {
                      var display = "";
                      console.log(table);
                      for (var i = 0; i < table.length; i += 2) {
                          display += "(" + table[i] + "," + table[i + 1] + ")";
                      }
                      $("#output").text(display);
                  }
              })

          }
      })


  </script>
</html>
